﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace my_console
{
    public class Square : Shape
    {
        public double Size { get; } // 宽

        // 构造函数
        public Square(double size)
        {
            Size = size;
        }

        // 计算长方形面积
        public double CalculateArea()
        {
            return Size * Size;
        }

        // 判断长方形是否合法
        public bool IsValid()
        {
            return Size > 0;
        }
    }
}
